/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.testis.testdriver.operations;

import org.testis.testdriver.AtofEnumaration.DebuggingMode;
import org.testis.testdriver.TestPart;

/**
 *
 * @author barisergun
 */
public class TestPartOperationResetPartResults extends TestPartOperationDecorator {
    
    private TestPart partInUse;

    public TestPartOperationResetPartResults(TestPart testPart)
    {
        partInUse = testPart;
    }


    @Override
    public boolean runOperation(DebuggingMode mode) throws InterruptedException
    {
        if (super.runOperation(mode)) {
            return runSpecificBehaviour();
        }
        else {
            return false;
        }
    }


    /**
     * This method is used to drive the specific Tasks that belong to this decorator
     * operation.
     *
     * @return boolean the result of operation. This result will affect the operation
     * of linked decorator tasks.
     */
    private boolean runSpecificBehaviour()
    {
        partInUse.resetTestPartRunTimeParameters();
        return true;
    }

}
